﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
///Sql2000Schema 的摘要说明
/// </summary>
public class Sql2000Schema:IDBSchema
{
	public Sql2000Schema()
	{
        
	}

    #region IDBSchema 成员

    public System.Collections.IEnumerable GetTablesInDB()
    {
        string sql = "select Name as Table_Name from sysobjects where xtype='u' and status>=0 order by name";
        return DBFactory.GetConn().exeTable(sql).DefaultView;
    }

    public System.Collections.IEnumerable GetColumnsInTable(string TableName)
    {
        string sql = "select column_name,data_type from information_schema.columns where table_name = N'" + TableName.Replace("'", "''") + "'";
        return DBFactory.GetConn().exeTable(sql).DefaultView;
    }

    #endregion

    #region IDBSchema 成员


    public System.Collections.IEnumerable GetViewsInDB()
    {
        string sql = "select Name as Table_Name from sysobjects where xtype='v' and status>=0 order by name";
        return DBFactory.GetConn().exeTable(sql).DefaultView;
    }

    #endregion
}
